﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ConsoleApp1.game1;
using ConsoleApp1.game2;
using ConsoleApp1.game3;

namespace ConsoleApp1
{
    class Program
    {

        static void Main(string[] args)
        {
            product pru = new product();
            Shooting pru1 = new Shooting();
            dota pru2 = new dota();
            pru.name = "守望先锋";
            pru.category = "射击类";
            pru.count = 500;
            pru.price = 29;
            pru.remarks = "射击类游戏";
            pru.timedate = DateTime.Now.ToString();
            //========================================================================
            pru1.name = "英雄联盟";
            pru1.category = "dota类";
            pru1.count = 100;
            pru1.price = 29;
            pru1.remarks = "射击类游戏";
            pru1.timedate = DateTime.Now.ToString();
            //========================================================================
            pru2.name = "方舟";
            pru2.category = "生存类";
            pru2.count = 50;
            pru2.price = 29;
            pru2.remarks = "射击类游戏";
            pru2.timedate = DateTime.Now.ToString();
            //操作====================================================================
            for (int j = 0; j < 3; j++)
            {
                Console.WriteLine("选择需要操作的游戏名字：");
                string i = Console.ReadLine();
                if (pru.name == i)
                {
                    prod(pru);
                }
                else if (pru1.name == i)
                {
                    prod1(pru1, pru);
                }
                else if (pru2.name == i)
                {
                    prod2(pru2, pru);
                }
            }
        }
        public static void prod(product pru)
        {
            Console.WriteLine("入库输入：1，销售收入：2");
            string k = Console.ReadLine();
            switch (k)
            {
                case "1":
                    pru.ShowInfo();
                    Console.WriteLine("入库数量：");
                    int a = int.Parse(Console.ReadLine());
                    pru.saleWarehousing(a);
                    a = 0;
                    break;
                case "2":
                    pru.ShowInfo();
                    Console.WriteLine("销售数量：");
                    a = int.Parse(Console.ReadLine());
                    pru.Sale(a);
                    a = 0;
                    break;
            }
        }
        public static void prod1(Shooting pru, product pru1)
        {
            Console.WriteLine("入库输入：1，销售收入：2");
            string k = Console.ReadLine();
            switch (k)
            {
                case "1":
                    pru1.ShowInfo();
                    Console.WriteLine("入库数量：");
                    int a = int.Parse(Console.ReadLine());
                    pru1.saleWarehousing(a);
                    a = 0;
                    break;
                case "2":
                    pru1.ShowInfo();
                    Console.WriteLine("销售数量：");
                    a = int.Parse(Console.ReadLine());
                    pru1.Sale(a);
                    a = 0;
                    break;
            }
        }
        public static void prod2(dota pru, product pru2)
        {
            Console.WriteLine("入库输入：1，销售收入：2");
            string k = Console.ReadLine();
            switch (k)
            {
                case "1":
                    pru2.ShowInfo();
                    Console.WriteLine("入库数量：");
                    int a = int.Parse(Console.ReadLine());
                    pru2.saleWarehousing(a);
                    a = 0;
                    break;
                case "2":
                    pru2.ShowInfo();
                    Console.WriteLine("销售数量：");
                    a = int.Parse(Console.ReadLine());
                    pru2.Sale(a);
                    a = 0;
                    break;
            }
        }
    }
}
